package org.JQbitorrentClinet.impl.V283;

import lombok.extern.slf4j.Slf4j;
import org.JQbitorrentClinet.QBitorrentConnectionInfo;
import org.JQbitorrentClinet.base.BaseProxy;
import org.JQbitorrentClinet.interfaces.ApplicationProxy;
import org.JQbitorrentClinet.pojo.application.ApplicationPreferences;
import org.JQbitorrentClinet.request.application.*;
import org.JQbitorrentClinet.pojo.application.BuildInfo;

@Slf4j
public class ApplicationProxy_V2_8_3 extends BaseProxy implements ApplicationProxy {

    public ApplicationProxy_V2_8_3(QBitorrentConnectionInfo connectionInfo) {
        super(connectionInfo);
    }

    @Override
    public String getApplicationVersion() {
        login();
        GetApplicationVersionParam param = GetApplicationVersionParam.builder().build();
        return process(param);
    }

    @Override
    public String getApiVersion() {
        login();
        GetApiVersionParam param = GetApiVersionParam.builder().build();
        return process(param);
    }

    @Override
    public BuildInfo getBuildInfo() {
        login();
        GetBuildInfoParam param = GetBuildInfoParam.builder().build();
        return process(param);
    }

    @Override
    public boolean shutDown() {
        login();
        ShutdownParam param = ShutdownParam.builder().build();
        process(param);
        return true;
    }

    @Override
    public ApplicationPreferences getApplicationPreferences() {
        login();
        GetApplicationPreferencesParam param = GetApplicationPreferencesParam.builder().build();
        return process(param);
    }

    @Override
    public boolean setApplicationPreferences(ApplicationPreferences applicationPreferences) {
        login();
        SetApplicationPreferencesParam param = SetApplicationPreferencesParam.builder().applicationPreferences(applicationPreferences).build();
        process(param);
        return true;
    }

    @Override
    public String getDefaultSavePath() {
        login();
        GetDefaultSavePathParam param = GetDefaultSavePathParam.builder().build();
        return process(param);
    }
}
